cd `dirname $0`

if [ -d "./dist/build/h5" ]; then
  echo "archive H5 target"
  cd ./dist/build/h5/
  zip -r -9 -q h5_app_50000005-dist.zip .
  mv h5_app_50000005-dist.zip /usr/share/nginx/html/h5_50000005-dist.zip
  echo "archived H5 target"
  cd ../../../
  pwd
fi

mkdir -p /root/generator/app_50000005/V9.8.9_9583468708236297/dist/
if [ -d "./dist/build" ]; then
  cp -r ./dist/build/* /root/generator/app_50000005/V9.8.9_9583468708236297/dist/
fi


rm -rf ./dist
mkdir -p /root/generator/app_50000005/V9.8.9_9583468708236297/source/
rm -rf ./node_modules
cp -r ./*      /root/generator/app_50000005/V9.8.9_9583468708236297/source/
# 拷贝资源文件到目标目录
zip -r app_50000005-mobile.zip .
cp app_50000005-mobile.zip /usr/share/nginx/html/app_50000005-mobile.zip
